home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_shw_tub_clue.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  130 lines

  1. # Jones 3D Cog Script
  2. #
  3. # Tub_Clue.cog
  4. #
  5. # Give the player a hint at the tubs in Div Room3 in SHW 
  6. #
  7. # [CMG]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.     
  14.  
  15. #    MESSAGES
  16.     message    entered        
  17.     message    startup        
  18.  
  19. #    PROPS
  20.     surface        trigger0    linkID=2
  21.     surface        trigger1    linkID=2
  22.     thing        tub
  23.  
  24. #    ACTORS
  25.     thing        indy        
  26.     thing        player        local        
  27.     
  28. #    CAMERAS
  29.     thing       tubCam        
  30.  
  31. #    CAMERA TARGETS
  32.     thing       tubMoveTarg    local
  33.     
  34.         
  35. #    VARIABLES
  36.     int            checked=0       local
  37.     int            snd       local
  38.  
  39. #    VECTORS
  40.     vector      tubCamTarg         local
  41.  
  42. #    TEMPLATES
  43.     template    ghostTpl=ghost      local
  44.  
  45. #    SOUNDS
  46.     sound       in_hidden=INXJ003.wav        local
  47.  
  48. end
  49.  
  50. # ========================================================================================
  51. code
  52.  
  53. startup:
  54.  
  55.     player = GetLocalPlayerThing();
  56.     return;
  57.  
  58. # ........................................................................................
  59. entered:
  60.  
  61. If ((GetSenderID() == 2) && (checked == 0))
  62.     {
  63.     checked = 1;
  64.     
  65.     # Stop the player
  66.     MakeMeStop();
  67.     
  68.     # SET UP THE ACTOR WITH CORRECT WEAPONS
  69.     CopyPlayerHolsters(player, indy);
  70.     
  71.     # Prep for scene...
  72.     curCam = GetCurrentCamera();
  73.     StartCutScene(1);
  74.     SetCameraLookInterp(2, 0);
  75.     SetCameraPosInterp(2, 0);
  76.     
  77.     AISetCutSceneMode(indy);
  78.     CopyOrientAndPos(player, indy);
  79.     SetThingFlags(player, 0x80000);
  80.     ClearThingFlags(indy, 0x80000);
  81.  
  82.     # move cam to known position
  83.     SetExtCamOffsetToThing(tubCam);
  84.     
  85.     # create target for secondary focus at player position.
  86.     tubCamTarg = VectorAdd(VectorTransformToOrient(player, '0.0 0.0 0.0'), GetThingPos(player));
  87.     tubMoveTarg = CreateThingAtPos(ghostTpl, GetThingSector(player), tubCamTarg, '0 0 0');
  88.     CaptureThing(tubMoveTarg);
  89.     
  90.     # offset camera to thing.
  91.     SetExtCamLookOffsetToThing(tubMoveTarg);
  92.  
  93.     Sleep(1.0);
  94.     snd = PlayVoice(indy, in_hidden, 1.0, 0);
  95.  
  96.     # switch to camera 2 with focus on ghost at indy's position
  97.     SetCameraFocus(2, tubCam);
  98.     SetCameraSecondaryFocus(2, tubMoveTarg);
  99.     SetCurrentCamera(2);
  100.     SetCameraFOV(90, 0, 0.0);
  101.  
  102.     # move camera focus object up to strut
  103.     animId = MoveThingToPos(tubMoveTarg, GetThingPos(tub), 1.5);
  104.  
  105.     AISetLookThing(indy, tub);
  106.     WaitForSound(snd);
  107.     Sleep(0.5);
  108.  
  109.     # put the player at actors' position, clear actor, show player
  110.     CopyOrientAndPos(indy, player);
  111.     AIClearCutSceneMode(indy);
  112.     ClearActorFlags(player, 0x200000);
  113.     ClearThingFlags(player, 0x80000);
  114.     SetThingFlags(indy, 0x80000);
  115.     
  116.     # Restore the cam, end the scene
  117.     SetCameraPosition(curCam, GetThingPos(tubCam));
  118.     SetCurrentCamera(curCam);
  119.     RestoreExtCam();
  120.     SetCameraFOV(90, 0, 0.0);
  121.     EndCutScene();
  122.     }
  123.  
  124. return;
  125.  
  126. # .....................................................................................
  127. end
  128.  
  129.  
  130.